package com.hsurosy.hsuchain.nft.api.user.request;

import com.hsurosy.hsuchain.nft.api.user.request.condition.UserIdQueryCondition;
import com.hsurosy.hsuchain.nft.api.user.request.condition.UserPhoneAndPasswordQueryCondition;
import com.hsurosy.hsuchain.nft.api.user.request.condition.UserPhoneQueryCondition;
import com.hsurosy.hsuchain.nft.api.user.request.condition.UserQueryCondition;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用户查询请求类
 *
 * @Author Hsu琛君珩
 * @Date 2024-10-04 17:20
 * @Description
 * @Version: v1.0.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserQueryRequest extends BaseRequest {

    /**
     * 用户查询条件
     */
    private UserQueryCondition userQueryCondition;

    /**
     * 根据用户ID创建查询请求
     *
     * @param userId 用户ID
     */
    public UserQueryRequest(Long userId) {
        UserIdQueryCondition userIdQueryCondition = new UserIdQueryCondition();
        userIdQueryCondition.setUserId(userId);
        this.userQueryCondition = userIdQueryCondition;
    }

    /**
     * 根据手机号创建查询请求
     *
     * @param telephone 用户手机号
     */
    public UserQueryRequest(String telephone) {
        UserPhoneQueryCondition userPhoneQueryCondition = new UserPhoneQueryCondition();
        userPhoneQueryCondition.setTelephone(telephone);
        this.userQueryCondition = userPhoneQueryCondition;
    }

    /**
     * 根据手机号和密码创建查询请求
     *
     * @param telephone 用户手机号
     * @param password 用户密码
     */
    public UserQueryRequest(String telephone, String password) {
        UserPhoneAndPasswordQueryCondition userPhoneAndPasswordQueryCondition = new UserPhoneAndPasswordQueryCondition();
        userPhoneAndPasswordQueryCondition.setTelephone(telephone);
        userPhoneAndPasswordQueryCondition.setPassword(password);
        this.userQueryCondition = userPhoneAndPasswordQueryCondition;
    }
}
